package sy.model;
// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * TOrderCash entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_order_cash", schema = "",catalog = "trade")
@DynamicUpdate(true)
@DynamicInsert(true)
public class TOrderCash implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String cashid;
	private String accno;
	private String accname;
	private Double price;
	private String acccurr;
	private String units;
	private String createtime;
	private String description;
	private Taccount taccount;
	private TcustomerInfo tcustomerInfo;

	// Constructors

	/** default constructor */
	public TOrderCash() {
	}

	/** minimal constructor */
	public TOrderCash(String cashid, String accno, String accname,
			Taccount taccount, TcustomerInfo tcustomerInfo) {
		super();
		this.cashid = cashid;
		this.accno = accno;
		this.accname = accname;
		this.taccount = taccount;
		this.tcustomerInfo = tcustomerInfo;
	}

	/** full constructor */
	

	// Property accessors
	@Id
	@Column(name = "CASHID", unique = true, nullable = false, length = 36)
	public String getCashid() {
		return this.cashid;
	}

	public TOrderCash(String cashid, String accno, String accname,
			Double price, String acccurr, String units, String createtime,
			String description, Taccount taccount, TcustomerInfo tcustomerInfo) {
		super();
		this.cashid = cashid;
		this.accno = accno;
		this.accname = accname;
		this.price = price;
		this.acccurr = acccurr;
		this.units = units;
		this.createtime = createtime;
		this.description = description;
		this.taccount = taccount;
		this.tcustomerInfo = tcustomerInfo;
	}

	public TOrderCash setCashid(String cashid) {
		this.cashid = cashid;
		return this;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ACCOUNTID", nullable = false)
	public Taccount getTaccount() {
		return taccount;
	}

	public TOrderCash setTaccount(Taccount taccount) {
		this.taccount = taccount;
		return this;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMERID", nullable = false)
	public TcustomerInfo getTcustomerInfo() {
		return tcustomerInfo;
	}

	public TOrderCash setTcustomerInfo(TcustomerInfo tcustomerInfo) {
		this.tcustomerInfo = tcustomerInfo;
		return this;
	}

	@Column(name = "ACCNO", nullable = false, length = 20)
	public String getAccno() {
		return this.accno;
	}

	public TOrderCash setAccno(String accno) {
		this.accno = accno;
		return this;		
	}

	@Column(name = "ACCNAME", nullable = false, length = 20)
	public String getAccname() {
		return this.accname;
	}

	public TOrderCash setAccname(String accname) {
		this.accname = accname;
		return this;
	}

	@Column(name = "PRICE", precision = 10)
	public Double getPrice() {
		return this.price;
	}

	public TOrderCash setPrice(Double price) {
		this.price = price;
		return this;
	}

	@Column(name = "ACCCURR", length = 10)
	public String getAcccurr() {
		return this.acccurr;
	}

	public TOrderCash setAcccurr(String acccurr) {
		this.acccurr = acccurr;
		return this;
	}

	@Column(name = "UNITS", length = 10)
	public String getUnits() {
		return this.units;
	}

	public TOrderCash setUnits(String units) {
		this.units = units;
		return this;
	}

	@Column(name = "CREATETIME", length = 30)
	public String getCreatetime() {
		return this.createtime;
	}

	public TOrderCash setCreatetime(String createtime) {
		this.createtime = createtime;
		return this;
	}

	@Column(name = "DESCRIPTION", length = 50)
	public String getDescription() {
		return this.description;
	}

	public TOrderCash setDescription(String description) {
		this.description = description;
		return this;
	}

}